home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-21 | 511 b | 27 lines | [TEXT/CWIE] |
- #include <iostream.h>
- #include <strstream.h>
- // Changed the file name from <strstrea.h>
- // to <strstream.h> -- Dave Mark, 10/20/95
-
- const short kBufferSize = 10;
-
- //--------------------------------------- main()
-
- int main()
- {
- char buffer[ kBufferSize ];
- ostrstream ostr( buffer, kBufferSize );
- short i = 0;
-
- while ( ostr << (char)('a' + i) )
- i++;
-
- cout << "Number of characters written: "
- << i << '\n';
-
- buffer[ kBufferSize - 1 ] = '\0';
-
- cout << "Buffer contents: " << buffer;
-
- return 0;
- }